/**
 * Copyright 2013 ABSir's Studio
 * 
 * All right reserved
 *
 * Create on 2013-6-18 下午2:15:51
 */
package com.absir.bean.inject;

import com.absir.bean.basis.BeanDefine;
import com.absir.bean.core.BeanFactoryImpl;

/**
 * @author absir
 * 
 */
public class InjectObserver {

	/** injectInvoker */
	InjectInvoker injectInvoker;

	/**
	 * @param injectInvoker
	 */
	public InjectObserver(InjectInvoker injectInvoker) {
		this.injectInvoker = injectInvoker;
	}

	/**
	 * @param beanFactory
	 * @param beanDefine
	 */
	public void changed(BeanFactoryImpl beanFactory, BeanDefine beanDefine, boolean register) {
		if (injectInvoker.support(beanDefine.getBeanType())) {
			injectInvoker.invoke(beanFactory, null);
		}
	}

}
